<h3><B>周周送IP6</B></h3>


<link href="../../../lib/dateTimePicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen">

<script type="text/javascript" src="../../../lib/dateTimePicker/js/bootstrap-datetimepicker.js"
        charset="UTF-8"></script>
<script type="text/javascript" src="../../../lib/dateTimePicker/js/locales/bootstrap-datetimepicker.zh-CN.js"
        charset="UTF-8"></script>

<a hidden ng-show="lottery.weekLottery.length!=0" class="btn-primary btn-sm nodecoration" data-toggle="modal"
   data-target="#addLottery">添加周活动</a>
<br>
<div class="form-group">
    <label class="control-label" for="textinput">小区:</label>
    <select ng-model="communityId" ng-options="m.objId as m.communityName for m in communityLabelList.data"
            ng-change="getLottery(communityId)">
        <option value="">-- 请选择 --</option>
    </select>
</div>
<div class="modal fade" id="addLottery" tabindex="-1" role="dialog"
     aria-labelledby="myModalLabel" aria-hidden="false">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"
                        aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                <h5 class="modal-title" id="myFresh">新增活动</h5>
            </div>
            <div class="modal-body">
                <div class="container">
                    <form action="" class="form-horizontal" role="form">
                        <fieldset>
                            <div class="form-group">
                                <label for="dtp_input1" class="col-md-2 control-label">开始时间：</label>

                                <div class="input-group date start_time col-md-5" data-date-format="yyyy-mm-dd h:ii"
                                     data-link-field="dtp_input1">
                                    <input class="form-control" size="16" type="text" value="" readonly
                                           ng-model="startTime">
                                    <span class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>
                                </div>
                                <input type="hidden" id="dtp_input1" value=""/><br/>
                            </div>
                            <div class="form-group">
                                <label for="dtp_input2" class="col-md-2 control-label">结束时间：</label>

                                <div class="input-group date end_time col-md-5" data-date-format="yyyy-mm-dd h:ii"
                                     data-link-field="dtp_input1">
                                    <input class="form-control" size="16" type="text" value="" readonly
                                           ng-model="endTime">
                                    <span class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>
                                </div>
                                <input type="hidden" id="dtp_input2" value=""/><br/>
                            </div>
                        </fieldset>
                    </form>
                </div>
            </div>
            <div class="modal-footer">
                <button ng-click="addLottery()" type="button"
                        class="btn btn-default btn-sm" data-dismiss="modal">确定
                </button>
            </div>
        </div>
    </div>
</div>

<div class="tab-content">
    <div class="tab-pane active" id="tab_a">
        <table class="table table-condensed">
            <thead>
            <tr>

                <th>开始时间</th>
                <th>结束时间</th>
                <th>参与人数</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="weekLottery in lottery.weekLottery">

                <td width="200">{{weekLottery.startTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                <td width="200">{{weekLottery.endTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                <td><a data-toggle="modal" data-target="#resModal{{$index}}">查看</a>
                    /{{weekLottery.lotteryTickets.length}}

                    <div class="modal fade" id="resModal{{$index}}" tabindex="-1" role="dialog"
                         aria-labelledby="myModalLabel" aria-hidden="true">
                        <div class="modal-dialog">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal"
                                            aria-label="Close"><span
                                            aria-hidden="true">&times;</span></button>
                                    <h5 class="modal-title" id="myModalLabel">参与名单：</h5>
                                </div>
                                <div class="modal-body">
                                    <table class="table table-condensed">
                                        <thead>
                                        <tr>
                                            <th>用户id</th>
                                            <th>昵称</th>
                                            <th>联系姓名</th>
                                            <th>联系电话</th>
                                            <th>单元</th>
                                            <th>房号</th>
                                            <th>本周发布数</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr ng-repeat="r in weekLottery.lotteryTickets">
                                            <td>{{r.user.objId}}</td>
                                            <td>{{r.user.nickName}}</td>
                                            <td>{{r.userName}}</td>
                                            <td>{{r.phone}}</td>
                                            <td>{{r.user.roomUnit}}</td>
                                            <td>{{r.user.roomNumber}}</td>
                                            <td>{{r.user.count}}</td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">关闭
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>

                </td>
                <td width="400">

                    <a class="btn btn-primary btn-xs"
                       data-toggle="modal"
                       data-target="#lotModal{{$index}}">查看中奖名单</a>

                    <div class="modal fade" id="lotModal{{$index}}">
                        <div class="modal-dialog">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal"
                                            aria-label="Close"><span
                                            aria-hidden="true">&times;</span></button>
                                    <h4 class="modal-title">中奖名单：</h4>
                                </div>
                                <div class="modal-body">

                                    <table class="table">
                                        <thead>
                                        <tr>
                                            <th>奖品</th>
                                            <th>用户id</th>
                                            <th>昵称</th>
                                            <th>姓名</th>
                                            <th>电话</th>
                                            <th>单元</th>
                                            <th>房号</th>
                                            <th ng-show="weekLottery.isOpen ==false">操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr>
                                            <td width="100">一等奖</td>
                                            <td width="100">{{weekLottery.one.user.objId}}</td>
                                            <td width="100">{{weekLottery.one.user.nickName}}</td>
                                            <td width="150">{{weekLottery.one.userName}}</td>
                                            <td width="100">{{weekLottery.one.phone}}</td>
                                            <td width="100">{{weekLottery.one.user.roomUnit}}</td>
                                            <td width="100">{{weekLottery.one.user.roomNumber}}</td>
                                            <td width="100" ng-show="weekLottery.isOpen ==false"><a
                                                    ng-click="lotteryDraw(weekLottery.objId,6)" type="button"
                                                    class="btn-primary btn-sm ">抽奖</a></td>
                                        </tr>
                                        <tr class="success">
                                            <td width="100">二等奖</td>
                                            <td width="100">{{weekLottery.two.user.objId}}</td>
                                            <td width="100">{{weekLottery.two.user.nickName}}</td>
                                            <td width="150">{{weekLottery.two.userName}}</td>
                                            <td width="100">{{weekLottery.two.phone}}</td>
                                            <td width="100">{{weekLottery.two.user.roomUnit}}</td>
                                            <td width="100">{{weekLottery.two.user.roomNumber}}</td>
                                            <td width="100" ng-show="weekLottery.isOpen ==false"><a
                                                    ng-click="lotteryDraw(weekLottery.objId,5)" type="button"
                                                    class="btn-primary btn-sm ">抽奖</a></td>
                                        </tr>
                                        <tr class="success">
                                            <td width="100">二等奖</td>
                                            <td width="100">{{weekLottery.three.user.objId}}</td>
                                            <td width="100">{{weekLottery.three.user.nickName}}</td>
                                            <td width="150">{{weekLottery.three.userName}}</td>
                                            <td width="100">{{weekLottery.three.phone}}</td>
                                            <td width="100">{{weekLottery.three.user.roomUnit}}</td>
                                            <td width="100">{{weekLottery.three.user.roomNumber}}</td>
                                            <td width="100" ng-show="weekLottery.isOpen ==false"><a
                                                    ng-click="lotteryDraw(weekLottery.objId,4)" type="button"
                                                    class="btn-primary btn-sm ">抽奖</a></td>
                                        </tr>
                                        <tr class="info">
                                            <td width="100">三等奖</td>
                                            <td width="100">{{weekLottery.four.user.objId}}</td>
                                            <td width="100">{{weekLottery.four.user.nickName}}</td>
                                            <td width="150">{{weekLottery.four.userName}}</td>
                                            <td width="100">{{weekLottery.four.phone}}</td>
                                            <td width="100">{{weekLottery.four.user.roomUnit}}</td>
                                            <td width="100">{{weekLottery.four.user.roomNumber}}</td>
                                            <td width="100" ng-show="weekLottery.isOpen ==false"><a
                                                    ng-click="lotteryDraw(weekLottery.objId,3)" type="button"
                                                    class="btn-primary btn-sm ">抽奖</a></td>
                                        </tr>
                                        <tr class="info">
                                            <td width="100">三等奖</td>
                                            <td width="100">{{weekLottery.five.user.objId}}</td>
                                            <td width="100">{{weekLottery.five.user.nickName}}</td>
                                            <td width="150">{{weekLottery.five.userName}}</td>
                                            <td width="100">{{weekLottery.five.phone}}</td>
                                            <td width="100">{{weekLottery.five.user.roomUnit}}</td>
                                            <td width="100">{{weekLottery.five.user.roomNumber}}</td>
                                            <td width="100" ng-show="weekLottery.isOpen ==false"><a
                                                    ng-click="lotteryDraw(weekLottery.objId,2)" type="button"
                                                    class="btn-primary btn-sm ">抽奖</a></td>
                                        </tr>
                                        <tr class="info">
                                            <td width="100">三等奖</td>
                                            <td width="100">{{weekLottery.six.user.objId}}</td>
                                            <td width="100">{{weekLottery.six.user.nickName}}</td>
                                            <td width="150">{{weekLottery.six.userName}}</td>
                                            <td width="100">{{weekLottery.six.phone}}</td>
                                            <td width="100">{{weekLottery.six.user.roomUnit}}</td>
                                            <td width="100">{{weekLottery.six.user.roomNumber}}</td>
                                            <td width="100" ng-show="weekLottery.isOpen ==false"><a
                                                    ng-click="lotteryDraw(weekLottery.objId,1)" type="button"
                                                    class="btn-primary btn-sm ">抽奖</a></td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-default" data-dismiss="modal">Close
                                    </button>

                                </div>
                            </div>
                        </div>
                    </div>
                    <a class="btn btn-primary btn-xs" ng-click="openLottery(weekLottery.objId)"
                       ng-show="weekLottery.isOpen ==false">开奖</a>
                </td>

            </tr>
            </tbody>
        </table>
    </div>
</div>


